package com.bjpowernode.beans;

import java.time.LocalDate;
import java.util.Objects;

/**
 * ClassName:Stu
 * Package:com.bjpowernode.beans
 * Description: 描述信息
 *
 * @date:2022/4/21 9:59
 * @author:动力节点
 */
public class Stu{
    int id;
    String name;
    String sex;
    LocalDate age;
    float score;
    public Stu(int id, String name, String sex, LocalDate age, float score) {
        this.id = id;
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.score = score;
    }

    public Stu() {
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public LocalDate getAge() {


        return age;
    }

    public void setAge(LocalDate age) {
        this.age = age;
    }

    public float getScore() {
        return score;
    }

    public void setScore(float score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "Stu{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                ", score=" + score +
                '}';
    }

    //根据需求ID不能重复
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Stu stu = (Stu) o;
        return id == stu.id;
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
